<template>
    <!--订单查询-->
    <div class="order">
        <avue-crud ref="crud"
                   v-model="form"
                   :page="page"
                   :data="tableData"
                   :table-loading="tableLoading"
                   :option="tableOption"
                   @on-load="getList"
                   @search-change="searchChange"
                   @refresh-change="refreshChange"
                   @size-change="sizeChange"
                   @current-change="currentChange"
                   @row-update="handleUpdate"
                   @row-save="handleSave"
                   @row-del="rowDel">
            <template slot="menu" slot-scope="scope">
                <el-button :size="scope.size" icon="el-icon-view" @click="$refs.infoDia.openDia(scope.row.id)" type="text">查看订单详情</el-button>
            </template>
        </avue-crud>
        <infoDia ref="infoDia"></infoDia>
    </div>
</template>

<script>
    import tableMixins from "@/mixins/tableMixins.vue"
    export default {
        name: "order",
        components: {
            'infoDia': () => import('@/components/order/infoDia.vue'),
        },
        mixins: [tableMixins],
        data() {
            return {
                //访问接口前缀
                url: "info-order",
                //查询url
                listUrl: 'findPageByMe',
                // 表格参数
                tableOption: {
                    border: true,
                    index: true,
                    indexLabel: '序号',
                    indexWidth: 50,
                    stripe: true,
                    align: 'center',
                    searchMenuSpan: 6,
                    labelWidth: 120,
                    height: '600px',
                    calcHeight: 400,
                    dialogWidth: 900,
                    menuWidth: 200,
                    menuAlign: 'center',
                    addBtn:false,
                    editBtn:false,
                    delBtn:false,
                    column: [
                        {
                            prop: 'id',
                            label: 'ID',
                            hide: true,
                            addDisplay: false,
                            editDisplay: false
                        },
                        {
                            prop: 'code',
                            label: '订单编号',
                            type: 'input',
                            overHidden: true,
                            minWidth: 60,
                            search: true,
                        },
                        {
                            prop: 'totalPrice',
                            label: '订单总价',
                            type: 'input',
                            overHidden: true,
                            minWidth: 60,
                        },
                        {
                            prop: 'receipt',
                            label: '收件人',
                            type: 'input',
                            overHidden: true,
                            minWidth: 60,
                        },
                        {
                            prop: 'receiptPhone',
                            label: '联系方式',
                            type: 'input',
                            overHidden: true,
                            minWidth: 60,
                        },
                        {
                            prop: 'deliveryDate',
                            label: '送达日期',
                            type: 'input',
                            overHidden: true,
                            minWidth: 60,
                        },
                        {
                            prop: 'state',
                            label: '状态',
                            type: 'input',
                            overHidden: true,
                            minWidth: 60,
                            dicUrl: "/common/getItem/order_state",
                        },
                    ]
                },
                //弹框显示判断
                dialogVisible: false,
            }
        }
    }
</script>

<style scoped lang="scss">
    .order {
        width: 70%;
        margin: 0 auto;
        padding-top: 20px;
        border: 1px solid #f2f2f2;
    }
</style>
